package summer_vacation.cullen.one10;

import java.util.Scanner;

/**
 * Created by Cullen on 2015/8/4.
 *
 */
public class N8 {
    public static void main(String[] args) {
        System.out.println("请输入需要n值：");
        Scanner a=new Scanner(System.in);

         int n=a.nextInt();
        int k,sum;
        k=1;
        sum=0;
        for(int i=1;i<=n;i++)
        {
            k=k*i;
            sum=sum+k;
        }
        System.out.println("和为："+sum);
    }
}
